<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <!--
        * @作者: 陈会丽 *
        * @时间：2024-2025-1 *
        -->
    </head>
    <body>
    
	<input id="num1">
	<select id="flag">
		<option value="+">+</option>
		<option value="-">-</option>
		<option value="*">*</option>
		<option value="/">/</option>
	</select>
	<input id="num2">
	<button id="btn1">=</button>
	</script>
	<input id="num3">
	</body>
	<script src="./demo06.js">
	 <script>
		$(function(){
			$("button").click(function(){
			var n1=parseInt($("#num1").val());
			var n2=parseInt($("#num2").val());
			var flag=$("#flag").val();
			if(flag=="+")
				{
				$("#num3").val(n1+n2);
				}
			else if(flag=="-")
				{
				$("#num3").val(n1-n2);
				}
			else if(flag=="*")
			{
				$("#num3").val(n1*n2);
			}
			else if(flag=="/")
			{
				$("#num3").val(n1/n2);
			}		
	});
	});
	 
	 </script>
    </body>
</html>